package cn.gson.work.controller;

import cn.gson.work.model.pojos.Profit;
import cn.gson.work.model.pojos.Profitcat;
import cn.gson.work.model.pojos.Project;
import cn.gson.work.model.service.ProfitsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ProfitController {
    @Autowired
    ProfitsService profitService;
    @GetMapping("/pt")
    @ResponseBody
    public List<Profit> Pt(){
        return profitService.Pt();
    }
    @GetMapping("/kl")
    @ResponseBody
    public List<Project> xm(){
        return profitService.xm();
    }
    @GetMapping("/lol")
    @ResponseBody
    public List<Profitcat> cate(){
        return profitService.cate();
    }
    @PostMapping("/addProfit")
    @ResponseBody
    public void addf(@RequestBody Profit profit){
        profitService.addf(profit);
    }
}
